package com.sunshine.student_register.database.register;

import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.PrimaryKey;

import com.sunshine.student_register.database.student.StudentEntity;

import java.util.Date;

import static androidx.room.ForeignKey.CASCADE;

/**
 * @author sunshine
 * @date 2020/5/30
 * 学生签到表
 */

@Entity(foreignKeys = @ForeignKey(entity = StudentEntity.class, parentColumns = "id", childColumns = "studentId", onDelete = CASCADE))
public class RegisterEntity {

    private int studentId;

    @PrimaryKey(autoGenerate = true)    //自增长
    private int id;     //签到id

    private long time;   //签到时间

    public RegisterEntity(int studentId, long time) {
        this.studentId = studentId;
        this.time = time;
    }

    public int getStudentId() {
        return studentId;
    }

    public void setStudentId(int studentId) {
        this.studentId = studentId;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public long getTime() {
        return time;
    }

    public void setTime(long time) {
        this.time = time;
    }
}
